import org.eclipse.swt.events.PaintEvent;
import org.eclipse.swt.events.PaintListener;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.SWT;
import org.eclipse.wb.swt.SWTResourceManager;
import org.eclipse.swt.widgets.Combo;
import org.eclipse.swt.widgets.Text;
import org.eclipse.swt.widgets.Canvas;


public class Invoice {

	protected Shell shell;
	private Text text;
	private Text text_1;

	/**
	 * Launch the application.
	 * @param args
	 */
	public static void main(String[] args) {
		try {
			Invoice window = new Invoice();
			window.open();
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

	/**
	 * Open the window.
	 */
	public void open() {
		Display display = Display.getDefault();
		createContents();
		shell.open();
		shell.layout();
		while (!shell.isDisposed()) {
			if (!display.readAndDispatch()) {
				display.sleep();
			}
		}
	}

	/**
	 * Create contents of the window.
	 */
	protected void createContents() {
		shell = new Shell();
		shell.setSize(700, 500);
		shell.setText("SWT Application");
		
		Combo combo = new Combo(shell, SWT.NONE);
		combo.setItems(new String[] {"A", "B", "C"});
		combo.setBounds(168, 122, 66, 22);
		combo.select(0);
		
		Label lblItems = new Label(shell, SWT.NONE);
		lblItems.setBounds(168, 102, 59, 14);
		lblItems.setText("Items");
		
		Label lblPrice = new Label(shell, SWT.NONE);
		lblPrice.setText("Price");
		lblPrice.setBounds(283, 102, 59, 14);
		
		text = new Text(shell, SWT.BORDER);
		text.setBounds(283, 125, 64, 19);
		
		text_1 = new Text(shell, SWT.BORDER);
		text_1.setBounds(396, 125, 64, 19);
		
		Label lblTotal = new Label(shell, SWT.NONE);
		lblTotal.setText("Total");
		lblTotal.setBounds(396, 102, 59, 14);
		
		//adding background
		final Display display = Display.getDefault();
		Canvas canvas = new Canvas(shell, SWT.NONE);
		canvas.addPaintListener(new PaintListener() {
			public void paintControl(PaintEvent arg0) {
					 org.eclipse.swt.graphics.Image image = new org.eclipse.swt.graphics.Image(display, "/Users/kennyha/Desktop/Eclipse Workplace/pokemonBackground.png");
					 arg0.gc.drawImage(image, 10, 10);

				        image.dispose();
				
			}
		});
		canvas.setBounds(-14, -22, 714, 500);
		
		Label lblInvoice = new Label(canvas, SWT.NONE);
		lblInvoice.setForeground(SWTResourceManager.getColor(SWT.COLOR_WHITE));
		lblInvoice.setBounds(253, 37, 136, 36);
		lblInvoice.setFont(SWTResourceManager.getFont("Lucida Grande", 25, SWT.BOLD));
		lblInvoice.setText("Invoice");
		

	}
}
